<?php

require __DIR__.'/../../../vendor/autoload.php';

use Gateway\app\nonMainland_H5\GetAuthUrlRequest;
use Gateway\CommUtil;
use Gateway\ESGateway;
use Gateway\JSONUtil;
use Gateway\Log;

$appCode = "d2808c1338ce01f3e3efdb486f9effb9";
$algo = "3";
$key = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhdQdw6uTGz+X4e+/eGpu4dcKrfrjQAe0tTQyn6TuKBobcsUsESkx9jcCeG4cpuxmN8jNeDAZsbTujNLD/aYl2g==";
$esGateway = new ESGateway($appCode, $algo, $key);

$getAuthUrlRequest = new GetAuthUrlRequest();
$getAuthUrlRequest->bizId = CommUtil::getTimeUUID();
$getAuthUrlRequest->livingType = "13";
$getAuthUrlRequest->idType = "1";
$getAuthUrlRequest->certName = "张三";
$getAuthUrlRequest->certNo = "1025591988666254299";
$getAuthUrlRequest->returnUrl = "http://www.baidu.com";
$getAuthUrlRequest->notifyUrl = "http://www.baidu.com";

$gatewayResponse = $esGateway->sendToGateWay(GetAuthUrlRequest::$act,$getAuthUrlRequest->toJsonStr());
Log::DEBUG("服务器返回数据：".$gatewayResponse->toJsonStr());
if ($gatewayResponse->bizContent != null) {
    Log::DEBUG("业务数据为：".$gatewayResponse->bizContent);
    $rsp = JSONUtil::fromJsonStr($gatewayResponse->bizContent);
}

